package com.icss.mqsp.data.encrypt.impl;

import com.icss.mqsp.data.encrypt.IDataEncrypt;
import sun.misc.BASE64Encoder;

public class Base64Encrypt
  implements IDataEncrypt
{
  public String encrtpy(String data)
  {
    byte[] b = null;
    String s = null;
    try
    {
      b = data.getBytes("utf-8");
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    if (b != null) {
      s = new BASE64Encoder().encode(b);
    }
    return s;
  }
}
